package imper.engine.entity;

import java.util.HashMap;
import java.util.Map;

public class GameMap
{
	protected Map<String, Land> _land;

	public GameMap()
	{
		_land = new HashMap<String, Land>();
	}

	public Land getLand(int x, int y)
	{
		return _land.get(getKey(x, y));
	}

	public Land getLand(Position pPosition)
	{
		return getLand(pPosition.getPosX(), pPosition.getPosY());
	}

	public void addLand(int x, int y, Land pLand)
	{
		_land.put(getKey(x, y), pLand);
	}

	protected String getKey(int x, int y)
	{
		return x + "|" + y;
	}
}
